package com.llb666.common.core.web.error;

/**
 * 全局常用异常错误.
 *
 * @author llb666
 */
public enum CommonError implements ErrorCode{

    RequestParamsInvalid(400, "参数校验错误:{0}"),

    NeedAuthentication(401, "登录认证错误:{0}"),

    RegisterInvalid(402, "注册参数检验错误:{0}"),

    NotAuthorized(403, "未授权"),

    OrderCreateError(9001, "订单错误"),

    UnExpected(10000, "系统未知错误"),
    ;

    private final Integer code;
    private final String msg;

    CommonError(final Integer code, final String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
